@extends('admin.layout')

@section('title', $title)

@section('content')
        
    
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                订单管理
                <small>订单详情</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">订单管理</a></li>
                <li class="active">订单详情</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                         @if (session('info'))
                            <div id='error'>                        
                                <div class="alert alert-danger">         
                                        <p>{{ session('info') }}</p>                                 
                                </div>
                            </div>
                        @endif
                        
                    <div class="col-xs-12">
                        <div class="box-header" style="border-bottom:1px solid #ccc">
                            <h3 class="box-title">查看订单</h3>
                        </div><!-- /.box-header -->
                    </div>
                        @foreach($data as $v)
                        <div class="col-xs-6" >
                            <div class="box-header" >
                                <p>订单号：{{ $v -> post_number }}</p>
                                <p>订单总额：￥{{ $v -> goods_price }}</p>
                            </div>     
                        </div>  
                         <div class="col-xs-6" >
                            <div class="box-header">
                                <p>订单状态：
                                    @if($v -> post_status == 0)
                                        待付款
                                    @elseif($v -> post_status == 1)
                                        待发货
                                    @elseif($v -> post_status == 2)
                                        待收货
                                    @elseif($v -> post_status == 3)
                                        已完成
                                    @elseif($v -> post_status == 4)
                                        <a >申请退款</a> 
                                    @elseif($v -> post_status == 6)
                                        已退款
                                    @endif
                                </p>
                                   
                                <p>邮费：￥0.00</p>
                            </div>     
                        </div>
                        <div class="col-xs-6" >
                            <div class="box-header" style="border-top:1px solid #ccc" >
                                <p>买家：{{ $v -> nickname }}</p>
                                <p>买家电话：{{ $v -> phone }}</p>
                                <p>
                                支付方式：@if($v -> post_method == 0)
                                                货到付款
                                           @else
                                                在线支付
                                            @endif 
                                </p>
                            </div>     
                        </div>

                         <div class="col-xs-6" >
                            <div class="box-header" style="border-top:1px solid #ccc">
                                <p>下单时间：{{ date('Y-m-d H:i:s', $v -> addtime) }}</p>
                                <p>
                                    完成时间:@if(($v -> post_status) == 3)
                                        {{ date('Y-m-d H:i:s', $v -> donetime) }}
                                    @else
                                        未完成
                                    @endif
                                </p>
                            </div>     
                        </div>
                          

                    <div class="col-xs-12">
                        <div class="box-header" style="border-top:2px solid #ccc;border-bottom:1px solid #ccc">
                            <h3 class="box-title">收货人信息</h3>
                        </div><!-- /.box-header -->
                    </div>
                   
                          <div class="col-xs-6" >
                            <div class="box-header" >
                                <p>收货人姓名：{{ $v -> acc_name }}</p>
                                <p>详细地址：{{ $v -> province}} {{ $v -> city }} {{ $v -> area }} {{ $v -> address }}</p>
                            </div>     
                        </div>  
                         <div class="col-xs-6" >
                            <div class="box-header">
                                <p>收货人电话：{{ $v -> acc_phone }}</p>
                                <p></p>
                            </div>     
                        </div>  
                    
                    <div class="col-xs-12">
                        <div class="box-header" style="border-top:2px solid #ccc;border-bottom:1px solid #ccc">
                            <h3 class="box-title">商品信息</h3>
                        </div><!-- /.box-header -->
                    </div>
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>商品信息</th>
                                    <th>购买数量</th>
                                    <th>单价</th>
                                    <th>实际支付</th>
                                    <th>积分抵现</th>
                                </tr>
                                </thead>
                                <tbody>
                               
                                <tr>
                                    <td>{{ $v -> goods_name }}</td>
                                    <td>{{ $v -> goods_number }}</td>
                                    <td>{{ $v -> goods_price }}</td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td>商品描述</td>
                                    <td colspan="4">{{ $v -> content }}</td>
                                </tr>
                              
                                </tbody>
                            </table>
                            @endforeach
                    
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->

                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    <script type="text/javascript">

        window.onload = function()
        {
           $('.mouse').css('cursor', 'pointer');
        }

    </script>

@endsection